<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
			<base href="<%=basePath%>">
		<!--[if lte IE 6]></base><![endif]-->
		<title>广东科学技术职业学院考生报到系统>>>>招就处</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link href="css/newindex.css" rel="stylesheet" type="text/css" />
		<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->

		<script src="js/jquery-1.5.js" language="javascript">
</script>
		<script src="js/newpublic.js" language="javascript">
</script>
<!-- 需要 -->

</script>

		<script language="javascript" type="text/javascript"
			src="js/jquery.flot.js">
			
</script>
	
		<!--                     下面是柱状图所要用到的两个文件         -->

		<script language="javascript" type="text/javascript"
			src="js/Bar-chart.js">
</script>

		<!-- 下面是饼图所要用到的两个文件 -->
		<script type="text/javascript" src="js/jquery.flot.pie.min.js">
</script>
		<script type="text/javascript" src="js/Pie-chart.js">
</script>
				<script src="js/jquery-ui-1.8.5.custom.min.js" language="javascript">
</script>
<script language="javascript">
var registerBarchart = new BarChart();
var subjectName = "all";
var areaName = "all";
$(function() {

	$.post("json/CollegeRegisterPaymentAction!initSelectData", function(data) {
		var areaList = data.jsonArea;
		//转换为对象
		areaList = eval('(' + areaList + ')');
		$("#subject").empty();
		$("#area").empty();
		$("#subject").append("<option value='all'>全部</option>");
		$("#area").append("<option value='all'>全部</option>");
		for (var a in areaList) {
			$("#area").append(
					"<option value='" + areaList[a] + "'>" + areaList[a] + "</option>");
		}
		var subjectList = data.jsonSubject;
		subjectList = eval('(' + subjectList + ')');
		for (var a in subjectList) {
			$("#subject").append(
					"<option value='" + subjectList[a] + "'>" + subjectList[a] + "</option>");
		}
	})
	
	update();
	$("#btn_search").unbind("click")
	$("#btn_search").click(function(){
		subjectName = $("#subject").val();
		areaName = $("#area").val();
		$.post("json/CollegeRegisterPaymentAction!allCollegeInfoByCondition",
		{'areaName':areaName,
		'subjectName':subjectName,
		'date':new Date
		}, function(data) {
		registerInfo = eval("(" + data.jsonAllCollegeRegisterInfo + ")");
		barRegisterData = eval("(" + data.barAllCollegeRegisterInfo + ")");
		fillRegisterInfo(registerInfo);
		registerBarchart.buildBarsChart($("#placeholderForBars"), $("#lengendForBars"), barRegisterData);
		})
	})
})

function update() {
	$.post("json/CollegeRegisterPaymentAction!allCollegeInfoByCondition",
		{'areaName':areaName,
		'subjectName':subjectName,
		'date':new Date
		}, function(data) {
		registerInfo = eval("(" + data.jsonAllCollegeRegisterInfo + ")");
		barRegisterData = eval("(" + data.barAllCollegeRegisterInfo + ")");
		fillRegisterInfo(registerInfo);
		registerBarchart.buildBarsChart($("#placeholderForBars"), $("#lengendForBars"), barRegisterData);
		})
	setTimeout("update()", 30000);
}

//填充报道情况数据
function fillRegisterInfo(data) {
	//徐了第一列外其余td删除
	$("tr#collegesList td:gt(0)").remove();
	$("tr#studentCount td:gt(0)").remove();
	$("tr#registeredCount td:gt(0)").remove();
	$("tr#registeredFemaleCount td:gt(0)").remove();
	$("tr#registeredMaleCount td:gt(0)").remove();
	
	for(var a in data) {
		var td = $("<td align='center'>" + data[a].collegeName + "</td>")
		$("#collegesList").append(td);
		
		var td = $("<td align='center'>" + data[a].studentCount + "</td>")
		$("#studentCount").append(td);
		
		var td = $("<td align='center'>" + data[a].registeredCount + "</td>")
		$("#registeredCount").append(td);
		
		var td = $("<td align='center'>" + data[a].registeredFemaleCount + "</td>")
		$("#registeredFemaleCount").append(td);
		
		var td = $("<td align='center'>" + data[a].registeredMaleCount + "</td>")
		$("#registeredMaleCount").append(td);
	}
}


</script>

	</head>

	<body onload="fixPNGAll()">
		<div id="bg">
			<div id="bodydiv">
				<div id="bodytitle">
					招就处
					<div>
						<a href="logoutAction" style="color: #F00;">退出</a>
					</div>
				</div>

				<div id="menudiv">

					<jsp:include page="entrance_header.jsp" />

				</div>
				<div id="content">
					<!--当前位置CSS-->
					<div class="top">
						<div class="topleft">
							<div class="dan">
								<div>
									当前位置>招就处>各学院概况
								</div>
							</div>
							<div class="F5">
								<img src="newimages/F5.png" />
							</div>
						</div>
						<div class="topright">
							<div class="toprightmin"></div>
							<div class="toprightmax"></div>
							<div class="toprightclose" onclick="if(confirm('是否确定退出！')){location.replace('loginoutAction')}" title="点击退出"></div>
						</div>
					</div>
					<!---->
					<!--内容-->
					<div class="condiv">
						<div class="submenu">

						</div>
						<div class="contable">
							<!--******************************-->
							<div id="t1" style="display: block;">
								<div class="title">
									各学院概况
								</div>

								<table width="100%" border="0" align="center" cellpadding="0"
									cellspacing="8">
									<tr>
										<td colspan="9" style="text-align: center;">
											科目：
											<select id="subject">
												<option>
													全部
												</option>
												<option>
													普高（文）
												</option>
												<option>
													普高（理）
												</option>
												<option>
													中职
												</option>
												<option>
													自主招生
												</option>
												<option>
													独立招生
												</option>
												<option>
													艺术
												</option>
											</select>
											&nbsp;&nbsp;&nbsp;&nbsp;地区：
											<select id="area">
												<option>
													全部
												</option>
												<option>
													广州
												</option>
												<option>
													顺德
												</option>
												<option>
													珠海
												</option>
												<option>
													汕头
												</option>
												<option>
													潮州
												</option>
											</select>
											<input type="button" value="查找" id="btn_search" />
										</td>
									</tr>
									<tr id="collegesList">
										<td width="10%">
											&nbsp;
										</td>
									</tr>
									<tr id="studentCount">
										<td align="center">
											总人数
										</td>
									</tr>
									<tr id="registeredCount">
										<td align="center">
											已报到人数
										</td>
									</tr>
									<tr id="registeredMaleCount">
										<td align="right">
											男生总数：
										</td>
									</tr>
									<tr id="registeredFemaleCount">
										<td align="right">
											女生总数：
										</td>
									</tr>
									<tr>
										<td height="75" colspan="9" align="center"
											style="border-top: 1px red dotted; font-size: 18px; color: red;">
											各学院实时报到率
										</td>
									</tr>
									<tr>
										<td colspan="9" align="center">
											<div style="width: 90%">
												<div id="placeholderForBars"
													style="width: 600px; height: 300px; float: left;"></div>
												<div id="lengendForBars" style="float: right; width: 150px"></div>
											</div>
										</td>
									</tr>
								</table>
							</div>
							<!-------**********************************-------->
							<!----------------------------------------------->
						</div>
					</div>
					<!---->
					<!---->
					<div class="condiv"
						style="width: 997px; position: relative; height: 20px; min-height: 20px; text-align: center;">
						<a href="computer/computer.html" target="_blank">计算机学院程序员之家</a>
					</div>
					<!---->

					<!--低部-->
					<div class="bottom">
						&nbsp;
					</div>
					<!---->
				</div>
			</div>
		</div>
	</body>
</html>
